<template>
<el-form-item label="主要产品" prop="subjectMainProduct">
    <el-checkbox-group v-model="SystemDataName" size="mini">
        <el-checkbox v-for="item in System" :key="item.pvCode" :label="item.propertyValue">{{ item.propertyValue }}</el-checkbox>
    </el-checkbox-group>
</el-form-item>
</template>

<script>
export default {
    props: {
        SystemName: {
            type: Array,
            default: function () {
                return []
            }
        }
    },
    components: {},
    data: () => ({
        System: [],
        SystemArrName: []
    }),
    computed: {
        propertyTypeName() {
            return this.System[0].propertyTypeName
        },
        SystemDataName: {
            get() {
                this.$emit('on-change', this.SystemArrName)
                if (this.SystemArrName.length) {
                    return this.SystemArrName
                } else {
                    return this.SystemName
                }

            },
            set(arr) {
                this.SystemArrName = arr
            }
        }
    },
    created() {
        this.propertyType()
    },
    methods: {
        propertyType() {
            this.$common
                .selectPage({
                    ptCode: "P13",
                    pageNumber: 1,
                    pageSize: 20,
                })
                .then((res) => {
                    if (res.errorCode === "00000") {
                        this.System = res.data.list;
                    }
                });
        },
    },
};
</script>

<style></style>
